package main

import (
	"fmt"
	"github.com/gin-gonic/gin"
)

func main() {
	r := gin.Default()
	r.GET("/evo-apigw/evo-oauth/%s/oauth/public-key", GETResponse)
	r.POST("/evo-apigw/evo-event/1.0.0/subscribe/mqinfo", CreateResponse)
	r.Run(":8084")
}

func GETResponse(context *gin.Context) {
	context.JSON(200, gin.H{
		"msg": "hello",
	})
}

func CreateResponse(context *gin.Context) {
	var d data
	fmt.Println(context.ShouldBindJSON(&d))
	fmt.Println(context.Param("test"))
	context.JSON(200, gin.H{
		"msg":  "订阅成功！",
		"uuid": "8239hf130",
		"host": "127.0.0.1:8083",
	})
}

type data struct {
	d1 string `json:"test"`
}
